import Cookies from 'js-cookie'

/**
 * Cookie中的存储
 */
const TokenKey = 'User-Token'
const UserId = 'UserId'
const RoelId = 'RoleId'
const Username = 'Username'
const Active = 'Active'

export function getToken () {
  return Cookies.get(TokenKey)
}

export function setToken (token) {
  return Cookies.set(TokenKey, token)
}

export function removeToken () {
  return Cookies.remove(TokenKey)
}

export function getUserId () {
  return Cookies.get(UserId)
}

export function removeUserId () {
  return Cookies.remove(UserId)
}

export function setUserId (userId) {
  return Cookies.set(UserId, userId)
}

export function setRoleId (roleId) {
  return Cookies.set(RoelId, roleId)
}

export function getRoleId () {
  return Cookies.get(RoelId)
}

export function removeRoleId () {
  return Cookies.remove(RoelId)
}

export function setUserName (username) {
  return Cookies.set(Username, username)
}

export function getUserName () {
  return Cookies.get(Username)
}

export function removeUserName () {
  return Cookies.remove(Username)
}

export function setActive (active) {
  return Cookies.set(Active, active)
}

export function getActive () {
  return Cookies.get(Active)
}

export function removeActive () {
  return Cookies.remove(Active)
}
